var i = getApp();

Page({
    data: {
        isTeamDividendShow: !1,
        teamDividendTitle: "",
        teamDividendRankingLevel: "0",
        teamDividendRankingAction: ""
    },
    onLoad: function(i) {
        this._getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    goteamDiv: function() {
        "1" == this.data.teamDividendRankingLevel ? wx.navigateTo({
            url: "/packageB/member/ranking/rankingListFirst/rankingListFirst?action=" + this.data.teamDividendRankingAction + "&title=" + this.data.teamDividendTitle
        }) : wx.navigateTo({
            url: "/packageB/member/ranking/rankingListSecond/rankingListSecond?action=" + this.data.teamDividendRankingAction + "&title=" + this.data.teamDividendTitle
        });
    },
    _getData: function() {
        var n = this, e = i.getNetAddresss("plugin.ranking.api.ranking.get-ranking-set");
        i._getNetWork({
            url: e,
            success: function(i) {
                var e = i.data;
                1 == e.result ? n.setTeamDividendInfo(e.data) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(i) {
                console.log(i);
            }
        });
    },
    setTeamDividendInfo: function(i) {
        null != i.team_dividend && null != i.team_dividend && "" != i.team_dividend ? this.setData({
            teamDividendRankingAction: "1" == i.team_dividend.ranking_level ? i.team_dividend.ranking_info_class : i.team_dividend.ranking_list_class,
            teamDividendRankingLevel: i.team_dividend.ranking_level,
            isTeamDividendShow: "1" == i.team_dividend.is_ranking,
            teamDividendTitle: i.team_dividend.ranking_name
        }) : this.setData({
            isTeamDividendShow: !1
        });
    }
});